import java.util.regex.Matcher
import java.util.regex.Pattern

def vehicleInfo = [:]
def auto = [:]
def context = [:]
def str = """\
            {
                "tempSave": "0",
                "VehicleInfo": {
                    "driveArea": ${vehicleInfo.driveArea},
                    "plateNo": "${auto.licensePlateNo}",
                    "registerDate": "${vehicleInfo?.registerDate ?: ""}",
                    "carVIN": "${auto.vinNo}",
                    "engineNo": "${auto.engineNo}",
                    "vehicleBrand": "${vehicleInfo?.vehicleBrand ?: ""}",
                    "vehicleModel": "${vehicleInfo?.makerModel ?: ""}",
                    "makerModel": "${context.orderExist ? (vehicleInfo.vehicleModel ?: "") : vehicleInfo?.makerModel}",
                    "moldName": "${context.orderExist ? (vehicleInfo?.moldName ?: ""): ""}",
                    "engineCapacity": "${vehicleInfo?.engineCapacity ?: ""}",
                    "moldCharacterCode": "${vehicleInfo?.moldCharacterCode ?: ""}",
                    "carryingCapacity": "${vehicleInfo.tonnage}",
                    "producingArea": "${vehicleInfo.producingArea}",
                    "glassManufacturer": "${vehicleInfo.glassManufacturer}",
                    "familyCode": "",
                    "rVehicleFamily": "${vehicleInfo?.familyName ?: ""}",
                    "riskflagCode": "",
                    "jyRiskFlagCode": "",
                    "EmptyWeight": "${vehicleInfo?.EmptyWeight ?: ""}",
                    "seatCount": "${vehicleInfo?.seat ?: ""}",
                    "complusoryInsuranceFlag": "${vehicleInfo.complusoryInsuranceFlag}",
                    "VehicleVariety1": "01",
                    "VehicleVariety2": "01",
                    "loanVehicleFlag": "0",
                    "plateColor": "1",
                    "purchasePrice": "${vehicleInfo?.price ?: ""}",
                    "marketDate": "",
                    "abs": "",
                    "yearPattern": "",
                    "fullWeightMax": "",
                    "fullWeightMin": "",
                    "seatMax": "",
                    "seatMin": "",
                    "groupName": "",
                    "vehicleClassCode": "",
                    "engineDesc": "",
                    "vehicleFgwCode": "",
                    "vehicleAlias": "",
                    "insuranceCode": "",
                    "batholith": "",
                    "bodyType": "",
                    "vehicleClassName": "",
                    "groupCode": "",
                    "vehicleFgwName": "",
                    "factoryName": "",
                    "antiTheft": "",
                    "power": "",
                    "searchCode": "",
                    "tbHcarType": "",
                    "insuranceClass": "",
                    "bakString1": "",
                    "bakString2": "",
                    "bakString3": "",
                    "bakString4": "",
                    "bakString5": ""
                },
                "PolicyBaseInfo": {
                    "provinceCode": "${context.provinceCode}",
                    "cityCode": "${context.cityCode}",
                    "branchCode": "${context.branchCode}",
                    "orgdeptCode": "${context.orgdeptCode}",
                    "commecialStartDate": "${context.commecialStartDate}",
                    "commecialEndDate": "${context.commecialEndDate}",
                    "applicationDate": "${context.applicationDate}",
                    "issueDate": "${context.issueDate}",
                    "otherSource": ""
                },
                "Opportunity": {
                    "licenseOwner": "${auto.owner}",
                    "mobile": "${context.applicant?.mobile}",
                    "opportunityId": "${context.opportunityId}"
                },
                "CoverageInfo": [
                    {
                        "coverageCode": "DamageLossCoverage",
                        "coverageName": "specialFlag",
                        "coverageAmount": "388000.0"
                    },
                    {
                        "coverageCode": "ThirdPartyLiabilityCoverage",
                        "coverageName": "机动车第三者责任保险",
                        "coverageAmount": "500000.00"
                    }
                ],
                "OrderInfo": {
                    "orderId": "${context.orderId}",
                    "orderNo": "${context.orderNo}"
                },
                "priceMap": {
                    "registerDate": "${vehicleInfo?.registerDate ?: ""}",
                    "startDate": "${context.startDate}",
                    "price": "${vehicleInfo?.price ?: ""}",
                    "taxPrice": "${vehicleInfo?.taxPrice ?: ""}",
                    "kindPrice": "${vehicleInfo?.kindPrice ?: ""}",
                    "taxKindPrice": "${vehicleInfo?.taxKindPrice ?: ""}"
                },
                "carMark": "",
                "confirmPlateNo": "",
                "random": "${context.baseInfoResult?.random ?: ""}",
                "marketDate": "",
                "insurancePageStatus": "${context.orderOpeartion ? "" :context.insurancePageStatus ?: ""}",
                "vehicleCode": "",
                "userId": "",
                "ocrUsedFlag": "",
                "plateNoForUpdate": "",
                "licenseOwnerForUpdate": ""
            }
        """

println str.tokenize()
println str.tokenize('&')
